﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:Common="clr-namespace:FlickrSample.View.Common" x:Class="FlickrSample.View.User.UserSearchView"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot">
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="UserFound">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0:0:1"/>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="NoError"/>
    			<VisualState x:Name="UserNotFound">
    				<Storyboard>
    					<ColorAnimation Duration="0" To="#FF803C3C" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
    	<i:Interaction.Behaviors>
            <ei:DataStateBehavior Value="True" TrueState="UserNotFound" FalseState="NoError" Binding="{Binding NoResult}"/>
    	</i:Interaction.Behaviors>
      
            
        <Border x:Name="border" Margin="10,10,10,0" Background="#FF4A4A4A" CornerRadius="5" Padding="5" Grid.Row="1" Height="64" VerticalAlignment="Top" BorderBrush="#FF858585" BorderThickness="1">
            <Grid>
                <Grid Height="24" VerticalAlignment="Center">
                	<Grid.ColumnDefinitions>
                		<ColumnDefinition Width="0.33*"/>
                		<ColumnDefinition Width="0.67*"/>
                	</Grid.ColumnDefinitions>
                	<TextBlock Text="username" Style="{StaticResource NormalTextBlock}" Margin="11,0" FontSize="14.667"/>
                    <TextBox IsEnabled="{Binding CanEdit}" Text="{Binding SearchUserName, Mode=TwoWay}" d:LayoutOverrides="Height" Background="LightGray" BorderBrush="{x:Null}" Foreground="Black" Grid.Column="1" Style="{StaticResource NoHighlightTextBox}"/>
                </Grid>
            </Grid>
        </Border>

        <Button Content="Search" Command="{Binding DoSearchCommand}" Width="200" Height="50" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,160,0,0" Style="{StaticResource NiceButton}" FontFamily="Segoe UI Light" FontSize="24" Foreground="White">
        	<Button.Background>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="#FF1E6FC8" Offset="0"/>
        			<GradientStop Color="#FF002A5A" Offset="1"/>
        			<GradientStop Color="#FF004DA3" Offset="0.496"/>
        			<GradientStop Color="#FF003D81" Offset="0.5"/>
        		</LinearGradientBrush>
        	</Button.Background>
        </Button>
    </Grid>
</UserControl>
